﻿using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;

namespace WPS.SDK.model.yunfile
{
    /// <summary>
    /// 创建文件夹类
    /// </summary>
    public class CreateFolder
    {
        public string fname;
        public string folderid;
        public long result;

        public static CreateFolder fromJsonObject(JObject jsonObject)
        {
            CreateFolder createFolder = new CreateFolder();
            JObject folderInfoObject = JsonConvert.DeserializeObject<JObject>(jsonObject["data"].ToString());
            if (folderInfoObject == null)
            {
                return createFolder;
            }
            createFolder.fname = folderInfoObject["file_name"].ToString();
            createFolder.folderid = folderInfoObject["open_folderid"].ToString(); ;
            createFolder.result = Convert.ToInt64(jsonObject["result"]);
            return createFolder;
        }
    }
}
